﻿@using Jb.Framework.Common.Forms
@using Jb.Framework.Web.Mvc
@model JbSection

@Html.GenerateHiddenFields(Model)

@foreach (var accRole in Model.AccessRole)
{ 
    @Html.HiddenFor(modelItem => accRole)
}

@{
    var htmlAttrs = new Dictionary<string, object> { { "title", @Model.HelpText } };
    InputHelper.InputAccessible(Model, (VisibilityMode)ViewBag.VisibleMode, ref htmlAttrs);
}

<div class="pull-left Jbsection" style="display: @(Model.VisibleMode != VisibilityMode.Both && Model.VisibleMode != (VisibilityMode)ViewBag.VisibleMode ? "none" : "block")">

    @if (!string.IsNullOrEmpty(Model.Title))
    {
        <div class="section-title-bg">
            <h2 class="section-title">@Model.Title</h2>
        </div>
    }
    @for (var i = 0; i < Model.Elements.Count(); i++)
    {

        @Html.EditorFor(m => m.Elements[i])

    }
</div>
<style>
    .Jbsection {
        border: solid 1px #eee;
        padding-left: 20px;
    }
</style>

